package translinkApp.DialogBoxes.ResolveLocation;

import translinkApp.views.dialog.LachDialogData;
import android.os.Parcel;
import android.os.Parcelable;

public class ResolveLocationDialogData extends LachDialogData {

	private String search;
	private boolean street;
	private boolean fromLocation;

	public boolean isFromLocation() {
		return fromLocation;
	}

	public String getSearch() {
		return search;
	}

	public boolean isStreet() {
		return street;
	}

	public ResolveLocationDialogData(String search, boolean street, boolean fromLocation) {
		this.search = search;
		this.street = street;
		this.fromLocation = fromLocation;
	}

	public ResolveLocationDialogData(Parcel in) {
		this(in.readString(), rBool(in), rBool(in));
	}

	private static boolean rBool(Parcel in) {
		return (Boolean) in.readValue(Boolean.class.getClassLoader());
	}

	public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
		public ResolveLocationDialogData createFromParcel(Parcel in) {
			return new ResolveLocationDialogData(in);
		}

		public ResolveLocationDialogData[] newArray(int size) {
			return new ResolveLocationDialogData[size];
		}
	};

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(getSearch());
		dest.writeValue(isStreet());
		dest.writeValue(isFromLocation());
	}

}
